POV-Ray : Newsgroups : povray.off-topic : how to change the cwd of a running shell? : Re: how to change the cwd of a running shell? Server Time
5 Sep 2024 09:21:45 EDT (-0400)
  Re: how to change the cwd of a running shell?  
From: clipka
Date: 22 Aug 2009 21:23:57
Message: <4a909a2d@news.povray.org>
Daniel Bastos schrieb:
> Is there a way to overcome this? I'd like to run a program that
> changes my current working directory. I don't want to do it through my
> shell's language.

You can /only/ do it through your shell's language.

The current working directory is part of the so-called "environment" of 
a process (i.e. a running program) - a collection of various information 
that is local to the process; there is exactly one situation where one 
process has control over another's environment: A new process will 
always start with its environment set to the same values as the process 
which started it. Aside from that, no process can tamper with the 
environment of another process - so no external program your shell could 
possibly start would have the ability to change the shell's working 
directory.

You will not find a "cd" command on /any/ Unix machine - it only exists 
as a built-in shell command.

(Assuming you're talking about some Unix variant here; but I guess other 
multitasking OS will handle the CWD in a similar fashion.)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.